import request from '@/utils/request'
/**
 * @description 获取所有权限
 * @returns
 */
export const getPermissionListAPI = () => {
  return request({
    url: '/sys/permission'
  })
}

/**
 * @description 添加权限
 * @returns
 */
export const addPermissionAPI = (data) => {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}

/**
 * @description 根据id获取权限详情
 * @returns
 */
export const getPermissionDetailAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`
  })
}

/**
 * @description 根据id更新权限详情
 * @returns
 */
export const editPermissionAPI = (data) => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}

/**
 * @description 根据id删除权限
 * @returns
 */
export const deletPermissionAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}
